
package com.ceres.device.dao;

import com.ceres.device.pojo.Device_Index;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

@Repository
public interface Device_indexMapper extends Mapper<Device_Index> {

    /**
     *  智能设备的指标关联表信息新增
     */

    @Insert("insert into t_device_index values(#{id},#{did},#{iid},#{rangel},#{accuracy},#{resolving_power})")
    int add(Device_Index device_indexEntity);

    /**
     *  智能设备的指标关联表根据id查询返回集合
     */

    @Select("select * from t_device_index where did=#{device_indexId}")
    List<Device_Index>select2Index(Integer device_indexId);

    /**
     *  智能设备的修改功能
     */
    @Update("update t_device_index set did=#{did},iid=#{iid},rangel=#{rangel},accuracy=#{accuracy},resolving_power=#{resolving_power} where id=#{id}")
    int updateByIndexDevice(Device_Index device_indexEntity);

    /**
     *  智能设备的指标关联表根据id查询返回集合
     */
    @Select("select did,iid,rangel,accuracy,resolving_power from t_device_index where did=#{device_indexId}")
    Device_Index select2Index1(Integer device_indexId);
}

